-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper support for gitignore in AppWatcher #4917
Add proper support for gitignore in AppWatcher #4917
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d975467
to
77a4f78
Compare
68457a7
to
1aa04a1
Compare
77a4f78
to
1b4002b
Compare
1aa04a1
to
f675d44
Compare
We detected some changes at packages/*/src and there are no updates in the .changeset. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success1968 tests passing in 892 suites. Report generated by 🧪jest coverage report action from 0442d42 |
1b4002b
to
0899271
Compare
a045e02
to
9e17f4f
Compare
0899271
to
4536258
Compare
9e17f4f
to
6f07989
Compare
4536258
to
ff1bc64
Compare
6f07989
to
b78e49c
Compare
/snapit |
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Test the snapshot by intalling your package globally: pnpm i -g @shopify/[email protected]
|
@@ -150,6 +151,7 @@ export class AppEventWatcher extends EventEmitter { | |||
if (!appEvent || appEvent.extensionEvents.length === 0) return | |||
|
|||
this.app = appEvent.app | |||
if (appEvent.appWasReloaded) this.fileWatcher?.updateApp(this.app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, how come we don't have to await
for the fileWatcher to update the app here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateApp
is not an async method, so we don't need to await :)
packages/app/src/cli/services/dev/app-events/file-watcher.test.ts
Outdated
Show resolved
Hide resolved
ff1bc64
to
599e99b
Compare
e12fef5
to
da90c96
Compare
da90c96
to
d6f0844
Compare
d72edd6
to
b2a69e8
Compare
b2a69e8
to
0442d42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't test it, but LGTM. Have you tested it in Windows? It's the typical thing that can be problematic there.
@@ -93,15 +81,20 @@ export class FileWatcher { | |||
async start(): Promise<void> { | |||
const {default: chokidar} = await import('chokidar') | |||
|
|||
this.watcher = chokidar.watch(this.watchPaths, { | |||
const extensionDirectories = [...(this.app.configuration.extension_directories ?? ['extensions'])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about including extension_directories
in the app model and adding the default value there?
Also, I see we are not using the value from the configuration in some places, like here. That approach would simplify the correct usage everywhere.
'**/node_modules/**', | ||
'**/.git/**', | ||
'**/*.test.*', | ||
'**/dist/**', | ||
'**/*.swp', | ||
'**/generated/**', | ||
...this.customGitIgnoredPatterns, | ||
'**/.gitignore', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd extract this list to a constant
I did not, will do it before merging 🙏 |
WHY are these changes introduced?
Fixes issues with file watching and extension creation detection during
app dev
.WHAT is this pull request doing?
ignore
package to properly handle.gitignore
files in extensions. If an extension defines it, anything in it will be ignored by the app watcher.How to test your changes?
.gitignore
file to an extension directory.gitignore
patterns are properly ignoredChecklist